// © 2009 Microsoft Corporation.  All rights reserved.
using System;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.ComponentModel;
using Microsoft.InformationSecurity.ISRM.TaskManagment.Classes;
using System.Collections.Generic;
using System.ServiceModel;

namespace Microsoft.InformationSecurity.ISRM.TaskManagment.WebService
{
    /// <summary>
    /// Interface for the Tasks WCF service.
    /// </summary>
    [ServiceContract()]
    public interface ITasksService
    {

        /// <summary>
        /// Returns a list of tasks
        /// </summary>
        [OperationContract()]
        ICollection<Task> GetTasks(int riskID);

        /// <summary>
        /// Returns a list of tasks for specific user
        /// </summary>
        [OperationContract()]
        ICollection<Task> GetTasksByUser(int riskID,int userID);
        

       /// <summary>
        /// Creates multiple tasks and returns the task information
        /// </summary>
        [OperationContract()]
        List<Task> AddTasks(List<Task> task);

        
        /// <summary>
        /// Updates a specific task
        /// </summary>
        [OperationContract()]
        void UpdateTask(Task task);

        /// <summary>
        /// Returns a task for spefied ID
        /// </summary>
        [OperationContract()]
        Task GetTask(int taskID);

        /// <summary>
        /// Adds a new category to the database.
        /// </summary>
        /// <param name="category">New category</param>
        /// <returns>Returns new category identifier</returns>
        [OperationContract()]
        int AddCategory(Category category);
        /// <summary>
        /// Updates a specific template
        /// </summary>
        [OperationContract()]
        void UpdateCategory(Category category);
        /// <summary>
        /// Removes a template from the system
        /// </summary>
        [OperationContract()]
        void DeleteCategory(Category category);
        /// <summary>
        /// Returns a list of all categories in the system
        /// </summary>
        [OperationContract()]
        ICollection<Category> GetAllCategories();
        /// <summary>
        /// Returns a list of active categories in the system
        /// </summary>
        [OperationContract()]
        ICollection<Category> GetActiveCategories();

        /// <summary>
        /// Adds a new group to the database
        /// </summary>
        /// <param name="group">New Group</param>
        /// <returns>Group Identifier</returns>
        [OperationContract()]
        int AddGroup(Group group);
        /// <summary>
        /// Updates a specific template
        /// </summary>
        [OperationContract()]
        void UpdateGroup(Group group);
        /// <summary>
        /// Removes a template from the system
        /// </summary>
        [OperationContract()]
        void DeleteGroup(Group group);
        /// <summary>
        /// Returns a list of all categories in the system
        /// </summary>
        [OperationContract()]
        ICollection<Group> GetAllGroups();
        /// <summary>
        /// Returns a list of active categories in the system
        /// </summary>
        [OperationContract()]
        ICollection<Group> GetActiveGroups();

        /// <summary>
        /// Returns the total number of tasks for the specified filter, operator and values
        /// </summary>
        [OperationContract()]
        int GetTasksCountByFilter(string field, string soperator, string[] values, bool isTaskUser, int personID, bool isActiveTasksOnly);

        /// <summary>
        /// Returns tasks for the specified filter, operator and values
        /// </summary>
        [OperationContract()]
        ICollection<Task> GetTasksByFilter(string field, string soperator, string[] values, string sortField, bool sortDescending, int pageSize, int startRowIndex, bool isTaskUser, int personID, bool isActiveTasksOnly);

                /// <summary>
        /// Returns the list of task status
        /// </summary>
        [OperationContract()]
        ICollection<TaskStatus> GetAllTaskStatus();
        
        /// <summary>
        /// Returns the list of users in the system
        /// </summary>
        [OperationContract()]
        ICollection<User> GetTasksUsers();

        /// <summary>
        /// Returns true if user has atleast one task assigned for the risk.
        /// </summary>
        [OperationContract()]
        bool IsValidTrustedTaskUser(int taskID, int userID);

    }
}
